//
//  uibarbuttonitem.swift
//  weibo
//
//  Created by swift on 17/2/23.
//  Copyright © 2017年 jason. All rights reserved.
//

import  UIKit
///创建 UIBarButtonItem
extension UIBarButtonItem {
    convenience init(title:String,fontSize:CGFloat = 16,target:Any?,action: Selector,isBack:Bool=false){
        let btn:UIButton = UIButton.cz_textButton(title, fontSize: fontSize, normalColor: UIColor.darkGray, highlightedColor: UIColor.orange)
        btn.addTarget(target, action: action, for: .touchUpInside)
        if isBack{
            btn.setImage(UIImage(named:"tabbar_compose_friend"), for: .normal)
            btn.setImage(UIImage(named:"tabbar_compose_friends_neo"), for: .highlighted)
            btn.sizeToFit()

        }
        //sel.init 实例化 uibarbuttonitem
        self.init(customView:btn)

    }
    
    
}

